import * as THREE from 'three';
const model = new THREE.Group();
const geometry = new THREE.SphereGeometry( 5, 32, 16 );
const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
const material2 = new THREE.MeshBasicMaterial( { color: 0x00ffff } );
const sphere1 = new THREE.Mesh( geometry, material );
const sphere2 = new THREE.Mesh( geometry, material2 );
model.add(sphere1,sphere2)
const A = new THREE.Vector3(0, 30, 0);//A点
const B = new THREE.Vector3(80, 0, 0);//B点
sphere1.position.copy(A)
sphere2.position.copy(B)
// 绘制A到B得箭头
const AB = B.clone().sub(A)
const L = AB.length()
const dir = AB.normalize()
const arrowHelper = new THREE.ArrowHelper(dir, A, L)
model.add(arrowHelper)
export default {model};